Skip to content

Avoid warning about unreachable things multiple times with --check-unreachable - #21839

Merged
JukkaL merged 1 commit into
python:masterfrom
A5rocks:dont-warn-twice
Aug 14, 2026
Merged

Avoid warning about unreachable things multiple times with --check-unreachable#21839
JukkaL merged 1 commit into
python:masterfrom
A5rocks:dont-warn-twice

Conversation

@A5rocks

@A5rocks A5rocks commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Refs #21835

On master, this is the case:

if False:
    if False:  # E: Statement is unreachable
        "not flagged!"  # E: Statement is unreachable

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@JukkaL JukkaL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good.

@JukkaL
JukkaL merged commit 7bafa9d into python:master Aug 14, 2026
25 checks passed
@A5rocks
A5rocks deleted the dont-warn-twice branch August 14, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants